<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    <title>鑫生态后台系统 - 登录</title>
    <meta name="keywords" content="鑫生态">
    <meta name="description" content="鑫生态">

    <link rel="shortcut icon" href="favicon.ico"> <link href="ADMIN_CSS/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="ADMIN_CSS/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <link href="ADMIN_CSS/animate.min.css" rel="stylesheet">
    <link href="ADMIN_CSS/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h6 class="logo-name">鑫生态</h6>

            </div>
            <h3>欢迎使用 鑫生态</h3>

            <form class="m-t" role="form" action="javascript:;">
                <div class="form-group">
                    <input type="input" class="form-control" placeholder="用户名" required name="account">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" required name="pwd">
                </div>
                <div><input type="text" class="form-control" style="width:110px;float:left;" placeholder="验证码" required name="captcha"><img style="float:right;" id="verify_img" src="{:captcha_src()}" alt="验证码" onclick="refreshVerify()"></div>
                <button style="clear:both; margin-top:80px;" type="submit" class="btn btn-primary block full-width m-b" id="login">登 录</button>


                <!--<p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>-->
                <!--</p>-->

            </form>
        </div>
    </div>
    <script src="ADMIN_JS/jquery.min.js?v=2.1.4"></script>
    <script src="ADMIN_JS/bootstrap.min.js?v=3.3.5"></script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <script type="text/javascript" src="ADMIN_JS/layer/layer.js" charset="UTF-8"></script>
    </body>
<script>
$("#login").click(function(){
    var account = $("[name='account']").val();
    var pwd = $("[name='pwd']").val();
    var captcha = $("[name='captcha']").val();
    if(account =='' || pwd==''){
        layer.msg("用户名和密码不能为空",{icon:5,time:1500});
        return false;
    }
    $.ajax({
        type:'post',
        url:'{:url("admin/login/doLogin")}',
        data:{'account':account,'pwd':pwd,'captcha':captcha},
        success:function(content){
            console.log(content);
            if(content.code == 1){
                layer.msg(content.msg,{icon:6,time:1500});
                setTimeout(function(){window.location.href="{:url('admin/index/index')}"},1500);
            }
            else{
                layer.msg(content.msg,{icon:5,time:1500});
                refreshVerify();
            }
        },
        error:function(){
            alert("错误");
        }
    })
})
function refreshVerify() {
    var ts = Date.parse(new Date())/1000;
    var img = document.getElementById('verify_img');
    img.src = "/captcha?id="+ts;
}
</script>

</html>